<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    //箭头函数没有自己的this,会往外层寻找
    const a={add:()=>{console.log(this);}}
    a.add() //window
    const b={
      add:function(){
        const adder=()=>{
          console.log(this);
        }
        adder()
      }
    }
    b.add()
    const addFn=b.add
    addFn()
  </script>
</body>
</html>